import request from './request'

// 知识文档相关接口
export class useDocumentApi {
    // 删除文档
    async deleteDocument(id: String) {
        console.log("调用知识文档删除接口");
        const response: any = await request({
            method: 'delete',
            url: '/document/delete/' + id,
        });
        return response;
    }

    // 查看所有文档信息
    async getDocumentsInfo() {
        console.log("获取所有文档信息");
        const response: any = await request({
            method: 'get',
            url: '/document/getFilesInfo',
        });
        return response;
    }

    // 关键词筛选文档
    async filterDocument(keyWord: string) {
        console.log("关键词筛选文档");
        const response: any = await request({
            method: 'get',
            url: '/document/filter',
            params: {
                keyWord
            }
        })
        return response;
    }
} 